import {instance} from "./request";
const baseURL = '/note'

/**
 * 
 * @param {*} method 1.未开始       
        2. 进行中
      3. 已结束  method
 * @param {*} data 
 * @returns 
 */
export function getNotes() {

  return  instance.get(baseURL+ `/notes`)

}
export function getNotesByLike(data) {
  let {currentPage,pageSize,info} = data;

  return  instance.get(baseURL+ `/notesByLike/${currentPage}/${pageSize}/${info}`)

}

export function getNotesByPage(data) {
  let {currentPage,pageSize,sortType,info} = data;

  return  instance.get(baseURL+ `/notes/${currentPage}/${pageSize}/${sortType}?info=${info}`)

}

export function deleteNote(id) {


  return  instance.delete(baseURL+ `/${id}`)

}

export function deleteNotePic(id,data =null) {
  return  instance.delete(baseURL+ `/deletePic/${id}`)

}

export function getActivitys(data=null) {

  return  instance.get(baseURL+ `/activityInf`,data)
}

export function getActivityById(method,data=null) {

  return  instance.get(baseURL+ `/activityInfs/${method}`,data)
  //  request({
    
  // }).then(res=>console.log(res))
}



export function updateActivity(data=null) {

  return  instance.put(baseURL+ '/update',data)
  //  request({
    
  // }).then(res=>console.log(res))
}

export function importFile(id,data=null) {

  return  instance.post(baseURL+ '/addSceneryPics/'+id,data)
  //  request({
    
  // }).then(res=>console.log(res))
}
export function deleteActivityById(id,data=null) {

  return  instance.delete(baseURL+ '/deleteActivityById/'+id,data)
  //  request({
    
  // }).then(res=>console.log(res))
}

export function addActivity(data=null) {

  return  instance.post(baseURL+ '/addActivity',data, {
    headers:{
    'Content-Type': 'application/json'
  }})
  //  request({
    
  // }).then(res=>console.log(res))
}

export function findActivityWorkByAcId(id,data=null) {

  return  instance.get(baseURL+ `/addActivity${id}`,data)

}

export function findActivityWorkByMap(id,data=null) {

  return  instance.get(baseURL+ `/activityWork/${id}/2`,data)

}
